package com.cyh;

import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import reactor.core.publisher.Mono;

public class MonoJustTest01 {

    public static void main(String[] args) throws Exception {
        Mono<String> fixedTimeMono = Mono.just(
            "Current time: " + LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_TIME));

        System.out.println(fixedTimeMono);
        fixedTimeMono.subscribe(time -> System.out.println("First: " + time));
        Thread.sleep(2000);
        fixedTimeMono.subscribe(time -> System.out.println("Second: " + time));
    }

}
